#ifndef SRMEDIAPLAYER_H
#define SRMEDIAPLAYER_H
#include "mediaplaylist.h"

#include <QMainWindow>
#include <QVideoWidget>  // 视频显示窗口
#include <QMediaPlayer>  // 播放器

QT_BEGIN_NAMESPACE
namespace Ui {
class SRMediaPlayer;
}
QT_END_NAMESPACE

class SRMediaPlayer : public QMainWindow
{
    Q_OBJECT

public:
    SRMediaPlayer(QWidget *parent = nullptr);
    ~SRMediaPlayer();

private slots:
    void on_BrowseButton_clicked();
    void on_PlayButton_clicked();
    void on_PauseButton_clicked();
    void on_NextButton_clicked();
    void on_PreviousButton_clicked();

private:
    void updateFilenameDisplay(const QUrl &media);
    void paintEvent(QPaintEvent *e);
    QVideoWidget *qVideoWidget;
    QMediaPlayer *qPlayer;
    MediaPlaylist *qPlaylist;
    Ui::SRMediaPlayer *ui;
};
#endif // SRMEDIAPLAYER_H
